package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginVo;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * @Author: zhaijiaqi
 * @Date: 2025/6/19 18:43
 * @Description:
 **/
@RestController
@RequestMapping("/user/index")
public class IndexController {

    @Autowired
    TbUserService tbUserService;

    /**
     * 登录接口
     * @param loginVo
     * @return
     */
    @PostMapping("/login")
    public R login(@RequestBody @Validated LoginVo loginVo){
        return tbUserService.login(loginVo);
    }

    /**
     * 树形列表根据用户Id查询
     * @param userId
     * @return
     */
    @PostMapping("/menuTreeList")
    public R menuTreeList(){
        return tbUserService.menuTreeList();
    }

    /**
     * 分页查询
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/ShopList")
    public R ShopList(@RequestBody PageInfoVo pageInfoVo){
        return tbUserService.ShopList(pageInfoVo);
    }
}
